import React, { Component } from 'react';
import {
  View,
  Text,
  ProgressBarAndroid,
  Modal,
  StyleSheet,
} from 'react-native';


export default class Loading extends Component {
  // 构造
  constructor(props) {
    super(props);
    // 初始状态
    this.state = {};
  }
  static defaultProps = {
    _dialogVisible: false,
  }


  render() {

    return(
      <Modal
        transparent = {true}
        visible={this.props._dialogVisible}
        onRequestClose={()=> this.onRequestClose()}
      >
        <View style={styles.loadingBox}>
          <ProgressBarAndroid styleAttr='Inverse' color='#FF4500' />
        </View>
      </Modal>
    );
  }


}
const styles = StyleSheet.create({

  loadingBox: { // Loading居中
    flex:1,
    alignItems:'center',
    justifyContent:'center',
    backgroundColor:'rgba(0, 0, 0, 0.5)', // 半透明
  }

});